#include <iostream>
using namespace std;

#include <vector>
#include <string>

int main()
{
    vector<vector<char>> vvc;

    for(size_t i = 0; i < 3; i++)
    {
        vector<char> vc;
        for(size_t j = 0; j < 3; j++)
        {
            char tmp;
            cin >> tmp;
            vc.push_back(tmp);
        }

        vvc.push_back(vc);
    }

    char tmp = 'O';
    // 判断行
    for(size_t i = 0; i < 3; i++)
    {
        int j = 0;
        if(vvc[i][j] == vvc[i][j + 1] && vvc[i][j + 1] ==  vvc[i][j + 2])
        {
            tmp = vvc[i][j];
            goto flag;
        }
    }

    // 判断列
    for(size_t j = 0; j < 3; j++)
    {

        int i = 0;
        if(vvc[i][j] == vvc[i + 1][j] && vvc[i + 1][j] ==  vvc[i + 2][j])
        {
            tmp = vvc[i][j];
            goto flag;
        }
    }

    // 判断两个斜线
    if(vvc[0][0] == vvc[1][1] && vvc[1][1] == vvc[2][2])
        tmp = vvc[0][0];
    
    if(vvc[0][2] == vvc[1][1] && vvc[1][1] == vvc[2][0])
        tmp = vvc[0][2];


    flag:
    if(tmp == 'K')
        cout << "KiKi wins!" << endl;
    else if(tmp == 'B')
        cout << "BoBo wins!" << endl;
    else
        cout << "No winner!" << endl;

    return 0;
}
